<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"  import="javax.servlet.*,javax.servlet.http.*" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Nstreams. Download App</title>
    <style type="text/css">
        .top {
            height: 50px;
            background: lightskyblue;
            text-align: center;
            line-height:50px;
        }
        .nav {
            height: auto;
            background: lightskyblue;
        }
    </style>
    <link rel="stylesheet" href="/jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="/scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/scripts/demos.js"></script>
    <script type="text/javascript" src="/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="/jqwidgets/jqxtabs.js"></script>
    <script type="text/javascript" src="/jqwidgets/jqxcheckbox.js"></script>
    <script type="text/javascript" src="/jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="/jqwidgets/jqxinput.js"></script>
    <script type="text/javascript" src="/jqwidgets/jqxwindow.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            // Create jqxTabs.
            $('#jqxTabs').jqxTabs({ width: '100%', height: 600, position: 'top'});
            $('#jqxTabs').jqxTabs({ animationType: 'fade' });
            $('#jqxTabs').jqxTabs({ disabled:true });
            //$('#userConfig').load('bindingtojson.htm');
            $("#loginWindow").jqxWindow({
                width: 250, resizable: false,  isModal: true, autoOpen: false,
                cancelButton: $("#btnCancel"), showCloseButton: false
            });
            $("#loginWindow").on('open', function () {
                $("#userName").jqxInput('selectAll');
            });
            $("#btnCancel").jqxButton({ theme: theme });
            $("#btnLogin").jqxButton({ theme: theme });
            $("#Logout").jqxButton({ width: '80',template: 'info'});
            $("#Logout").click(function () {
                <%
                    //session.setAttribute("uname",null);
                %>
                location.reload();
            });
            $("#Login").jqxButton({ width: '80',template: 'info'});
            $("#Login").click(function () {
                $("#loginWindow").jqxWindow('open');
            });
            $("#btnLogin").click(function () {
                <%
                    application.setAttribute("uname","uLogin");
                %>
                $("#GGusername").text('uLogin');
                $('#jqxTabs').jqxTabs({ disabled:false });
                $("#Login").hide();
                $("#loginWindow").jqxWindow('close');
            });
            <%
                String uname = (String)application.getAttribute("uname");
            %>
            var username = <%=uname %>;
            if(username==null) {
                $('#jqxTabs').jqxTabs({ disabled:true });
            }else{
                $('#jqxTabs').jqxTabs({ disabled:false });
            }
        });
    </script>
</head>
<body>
<div id='jqxWidget'>
    <div class="top">
        <table width="100%">
            <tr>
                <td>恩讯NAS文件下载系统</td>
                <td width="100" id="GGusername">请先登录</td>
                <td width="100">
                    <div id='Logout'>注销</div>
                </td>
                <td width="100">
                    <div id='Login'>登录</div>
                </td>
            </tr>
        </table>
    </div>
    <div class="nav">
        <div id='jqxTabs'>
            <ul>
                <li>欢迎</li>
                <li>用户设置</li>
                <li>下载完成</li>
                <li>正在下载</li>
                <li>失败列表</li>
            </ul>
            <div id="head">
                欢迎，请登录。
            </div>
            <div id="userConfig">
                uc.
            </div>
            <div id="downloadOK">
                dOK.
            </div>
            <div id="downloading">
                ding.
            </div>
            <div id="downloadError" >
                dError
            </div>
        </div>
    </div>
    <div id="loginWindow" style="display: none;">
        <div>登录</div>
        <div style="overflow: hidden;">
            <table>
                <tr>
                    <td align="right">登录用户名:</td>
                    <td align="left"><input id="userName" /></td>
                </tr>
                <tr>
                    <td align="right">密      码:</td>
                    <td align="left"><input id="upassword" /></td>
                </tr>
                <tr>
                    <td align="right"></td>
                    <td style="padding-top: 10px;" align="right">
                        <input style="margin-right: 5px;" type="button" id="btnLogin" value="登录" />
                        <input id="btnCancel" type="button" value="取消" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<div class="top">Nstreams © 2015-2020. All Rights Reserved.</div>
</body>
</html>